<template>
	<el-container>
		<el-main class='x-main-edit'>
			<el-form ref="form" :rules="form_rules" :model="form" size="mini" label-width="15%">
				<el-tabs type="border-card" v-model="page_tag">
					<!---->
					<!---->
					<el-tab-pane :label="page_info.title" name="1">
						<el-form-item label="网点" prop="csku_cspu_id">
							<el-select filterable v-model="form.csnk_cnetwork_id" placeholder="请选择">
								<el-option v-for="item in page_info.list_network"
										   :label="item.cnetwork_name"
										   :key="item.cnetwork_id"
										   :value="item.cnetwork_id">
								</el-option>
							</el-select>
						</el-form-item>
					</el-tab-pane>
					<!---->
					<!---->
				</el-tabs>
			</el-form>
			<!---->
			<!---->
			<!-- 按钮部分 -->
			<div class="save_wrap">
				<el-button @click="g_page.funcBack" size="mini">返回</el-button>
				<el-button type="success" @click="g_page.funcSave" size="mini">保存</el-button>
				<el-checkbox v-if="page_info.is_admin_edit" style="margin-left: 10px;" label="保存后停留" v-model="checked"/>
			</div>
			<!---->
			<!---->
			<!---->
		</el-main>
	</el-container>
</template>

<script>
	import SkuInfo from '@/views/app_wxapp/app_car/components/SkuInfo'
	import SkuState from '@/views/app_wxapp/app_car/components/SkuState'

	export default {
		components: {
			SkuInfo,
			SkuState
		},
		data() {
			let page_data = {}
			//
			page_data = this.g_cc.funcGetInitData(page_data)
			//
			return page_data
		},
		mounted() {
			console.log('mounted')
			console.log(this.$route.query)

			this.g_page.funcSetVue(this)
			//
			this.g_page.funcSetApiUrlEdit('/xadmin/app_car/app_car__sku_network__edit')
			this.g_page.funcSetApiUrlSave('/xadmin/app_car/app_car__sku_network__edit/save')
			let page = this
			//验证
			this.form_rules = {
				__test: [{
					required: true,
					message: '请输入原密码',
					trigger: 'blur'
				}]
			}

			let data = this.$route.query
			this.g_page.funcEdit(data)
		},
		methods: {
			funcShowDialogAfter() {
				console.log('funcShowDialogAfter')

				// this.$nextTick(() => {
				// 	this.$refs['abc_long_00'].setContent(this.form.abc_long_00)
				// })
			},
			//保存之前
			funcSaveBefore(data) {
				console.log('funcSaveBefore', data)

				// data.abc_str_00 = this.g_page.funcImgArrToStr(data.abc_str_00_imgs)

				return data
			},
			/////////////////////////
		}
	}
</script>
